﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link rel="stylesheet" type="text/css" href="./css/scrollbar.css" />
    <style>
        p {
            word-wrap: break-word;
            word-break: normal;
        }
    </style>
</head>
<body style="background-color: #232425; margin: 0px;color:#fff;overflow:hidden;font-family:'Microsoft YaHei';" onmouseover="scroll()" onmouseout="    scrollhidden()">
    <input type="hidden" id="hid_rnoticecounts" value="0" />
    <input type="hidden" id="hid_rnoticecounte" value="0" />
    <div id="div_rnotice" style="padding:0px 10px;"></div>
    <script>
        //添加房间公告
        function addRoomNotice(str) {
            //document.getElementById('div_horn').innerHTML += str + "<br>";
            var rnoticecounts = document.getElementById("hid_rnoticecounts").value;
            var rnoticecounte = document.getElementById("hid_rnoticecounte").value;
            document.getElementById("hid_rnoticecounte").value = parseInt(rnoticecounte) + 1;
            if (rnoticecounte - rnoticecounts >= 0) {
                rnoticecounts++;
                document.getElementById("hid_rnoticecounts").value = rnoticecounts;
                var divobj2 = document.getElementById("rnotice" + rnoticecounts);
                if (divobj2 != null) {
                    document.getElementById('div_rnotice').removeChild(divobj2);
                }
            }
            var pobj = document.createElement("p");
            pobj.id = "rnotice" + (parseInt(rnoticecounte) + 1).toString();
            pobj.innerHTML = str;
            document.getElementById('div_rnotice').appendChild(pobj);
            document.getElementById('div_rnotice').scrollTop = document.getElementById('div_rnotice').scrollHeight;
        }
        function clearhtml() {
            document.getElementById('div_rnotice').innerHTML = "";
        }
        function scroll() {
            document.body.style.overflowY = "auto";
        }
        function scrollhidden(obj) {
            document.body.style.overflowY = "hidden";
        }
    </script>
</body>
</html>
